<script setup lang="ts">
import { useRouter } from 'vue-router'
import { onMounted } from 'vue'

const router = useRouter()

const goToForm = () => {
  router.push('/form')
}

onMounted(() => {
  setTimeout(() => {
    goToForm()
  }, 2000)
})
</script>

<template>
  <div class="welcome-container">
    <div class="welcome-content">
      <img src="../assets/logo.png" class="logo" alt="Logo" />
      <h1 class="welcome-text">欢迎来到 Vue 3 + TypeScript 项目</h1>
    </div>
  </div>
</template>

<style scoped>
.welcome-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

.welcome-content {
  text-align: center;
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 600px;
  margin: 1rem;
}

.logo {
  width: min(200px, 40vw);
  height: auto;
  margin-bottom: 2rem;
}

.welcome-text {
  color: #2c3e50;
  font-size: clamp(1.2rem, 4vw, 2rem);
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .welcome-container {
    padding: 0.5rem;
  }
  
  .welcome-content {
    padding: 1rem;
    margin: 0.5rem;
  }
  
  .logo {
    width: min(150px, 50vw);
    margin-bottom: 1rem;
  }
  
  .welcome-text {
    font-size: clamp(1rem, 5vw, 1.5rem);
  }
}
</style> 